Conversation
…rect name,and creating the new one with the valid name...) + homework_1 + README.md
|
Why did you add HW_2 label? It means I approved your homework, which I didn't |
Sorry, this is my fault(. I will try not to do like this anymore) |
|
Clean commit history, good! |
| implementation 'junit:junit:4.12' | ||
| implementation 'junit:junit:4.12' |
There was a problem hiding this comment.
I'm not sure these are needed. You allowed junit in source code
| import java.util.Scanner; | ||
|
|
||
|
|
||
| public class TrafficLight { |
There was a problem hiding this comment.
Hope, that i fixed it.
| public class PyramidPrinter { | ||
|
|
||
| public void run(){ | ||
| Scanner scanner = new Scanner(System.in); |
There was a problem hiding this comment.
Opt: you should open scanner in try block. What if you'll get an exception in sout?
| System.out.println("Only 1 non-negative integer is allowed as passed parameter! Please, try again"); | ||
| return; | ||
| } | ||
| //adding finally block (28.07.2021) |
There was a problem hiding this comment.
Opt: These comments are unnessessary
| try { | ||
| int base = scanner.nextInt(); | ||
| if (base < 0) { | ||
| throw new Exception(); |
There was a problem hiding this comment.
Opt: better use specific exception from Runtime hierarchy
| if (base < 0) { | ||
| throw new Exception(); | ||
| } | ||
| drawingThePyramid(base); |
There was a problem hiding this comment.
| drawingThePyramid(base); | |
| drawPyramid(base); |
There was a problem hiding this comment.
Ok, done (renamed).
| if (base == 0){ | ||
| System.out.println(""); | ||
| return; | ||
| } |
There was a problem hiding this comment.
You were right, it's no needed. Removed.
| public static void main(String[] args) { | ||
| // initializeForTests(); | ||
| new RandomCharsTable().run(); | ||
| // isValidLastStringForEven("Even letters - "); |
There was a problem hiding this comment.
All excessive comments/commented-out lines of code should be removed. Keep your code clean
There was a problem hiding this comment.
It seems that i fixed it.
| String inString = scanner.nextLine(); | ||
| String tempStr = ""; | ||
| char c; | ||
| int cols =0; int rows =0; |
| int cols =0; int rows =0; | ||
| String strategy = ""; | ||
| int paramCount=0; | ||
| // parse of input procedure |
There was a problem hiding this comment.
If you need a comment, means you can move it to a separate method
There was a problem hiding this comment.
Done (another method was created).
| // if everything valid with input - create and print result | ||
| int [][] matrix = createCharsTable(cols, rows); | ||
| printCharsTable(matrix, strategy); | ||
| }//end of run; |
There was a problem hiding this comment.
I didn't understand what exactly wrong, but i refactored it)
|
|
||
| import java.util.Scanner; | ||
|
|
||
| public class RandomCharsTable { |
There was a problem hiding this comment.
Please fix namings, declarations, whitespaces, cleanup and simplify your code
There was a problem hiding this comment.
I hope, that i've done it.

my first commit...again (after deleting my old branch, with the incorrect name and creating the new one with the valid name) + homework_1 + README.md